package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @author 梦龙
 * @date 2023/12/3 15:29
 */
@Mapper
public interface UserMapper {

    /**
     * @description:根据openid查询用户
     * @return: com.sky.entity.User
     * @author: 梦龙
     * @time: 2023/12/3 15:33
     */
    @Select("select * from sky_take_out.user where openid = #{openid}")
    User getByOpenid(String openid);

    /**
     * @description:插入数据到用户表，相当于注册新用户
     * @return: void
     * @author: 梦龙
     * @time: 2023/12/4 14:37
     */
    void insert(User user);

    @Select(" select * from sky_take_out.user where id = #{userId}")
    User getById(Long userId);

    Integer getCountByMap(Map map);

}
